import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    meta: {
      icon: 'lucide:home',
      order: -2,
      title: '财务管理',
    },
    name: 'Financial',
    path: '/financial',
    children: [
      {
        name: 'FinancialHome',
        path: '/home',
        component: () => import('#/views/financial/home/index.vue'),
        meta: {
          affixTab: true,
          icon: 'lucide:home',
          title: '主页',
        },
      },
      {
        name: 'FinancialVoucher',
        path: '/voucher',
        meta: {
          icon: 'lucide:file-text',
          title: '记账凭证',
        },
        children: [
          {
            name: 'VoucherList',
            path: '/list',
            component: () => import('#/views/financial/voucher/list.vue'),
            meta: {
              title: '凭证列表',
            },
          },
          {
            name: 'VoucherAdd',
            path: '/add',
            component: () => import('#/views/financial/voucher/add.vue'),
            meta: {
              title: '新增凭证',
            },
          },
        ],
      },
      {
        name: 'FinancialLedger',
        path: '/ledger',
        meta: {
          icon: 'lucide:book',
          title: '账簿',
        },
        children: [
          {
            name: 'LedgerGeneral',
            path: '/general',
            component: () => import('#/views/financial/ledger/general.vue'),
            meta: {
              title: '总账',
            },
          },
          {
            name: 'LedgerDetail',
            path: '/detail',
            component: () => import('#/views/financial/ledger/detail.vue'),
            meta: {
              title: '明细账',
            },
          },
        ],
      },
      {
        name: 'FinancialManagement',
        path: '/management',
        component: () => import('#/views/financial/management/index.vue'),
        meta: {
          icon: 'lucide:settings',
          title: '管理账簿',
        },
      },
      {
        name: 'FinancialClosing',
        path: '/closing',
        meta: {
          icon: 'lucide:lock',
          title: '结账',
        },
        children: [
          {
            name: 'PeriodEndClosing',
            path: '/period-end',
            component: () => import('#/views/financial/closing/period-end/index.vue'),
            meta: {
              title: '期末结转',
            },
          },
        ],
      },
      {
        name: 'FinancialAssets',
        path: '/assets',
        component: () => import('#/views/financial/assets/index.vue'),
        meta: {
          icon: 'lucide:building',
          title: '固定资产',
        },
      },
      {
        name: 'FinancialReports',
        path: '/reports',
        component: () => import('#/views/financial/reports/index.vue'),
        meta: {
          icon: 'lucide:bar-chart',
          title: '报表中心',
        },
      },
      {
        name: 'FinancialSettings',
        path: '/settings',
        component: () => import('#/views/financial/settings/index.vue'),
        meta: {
          icon: 'lucide:cog',
          title: '基础设置',
        },
      },
      {
        name: 'FinancialTax',
        path: '/tax',
        component: () => import('#/views/financial/tax/index.vue'),
        meta: {
          icon: 'lucide:calculator',
          title: '报税',
        },
      },
      {
        name: 'FinancialInvoice',
        path: '/invoice',
        component: () => import('#/views/financial/invoice/index.vue'),
        meta: {
          icon: 'lucide:receipt',
          title: '发票',
        },
      },
    ],
  },
];

export default routes;
